import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Lenovo
 * Date: 2024-07-07
 * Time: 20:19
 */
public class Tset {
    public static void main(String[] args) {
        hanoi(3, 'A', 'B','C');
    }
    /**
     * 将盘子从pos1移动到pos2
     *  pos1 起始柱子
     *  pos2 结束柱子
     */
    public static void move(char pos1, char pos2){
        System.out.print(pos1 + "->" + pos2 + " ");
    }

    /**
     *  n 盘子个数
     *  pos1 起始柱子
     *  pos2 中转柱子
     *  pos3 目标柱子
     */
    public static void hanoi(int n, char pos1, char pos2, char pos3){
        if (n == 1){
            move(pos1, pos3);
            return;
        } else{
            hanoi(n-1, pos1, pos3, pos2);
            move(pos1, pos3);
            hanoi(n-1, pos2, pos1, pos3);
        }
    }
    public static void main9(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        double c = scanner.nextDouble();
        double d = scanner.nextDouble();
        double e = scanner.nextDouble();
        int max1 = max(a,b);
        double max2 = max(c,d,e);
        System.out.println(max1);
        System.out.println(max2);
    }
    public static int max(int a,int b){
        int max = a > b ? a : b;
        return max;
    }
    public static double max(double c,double d,double e){
        double max = c > (d > e ? d : e) ? c : (d > e ? d : e);
        return max;
    }
    public static void main8(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        double c = scanner.nextDouble();
        double d = scanner.nextDouble();
        double e = scanner.nextDouble();
        int sum1 = add(a,b);
        double sum2 = add(c,d,e);
        System.out.println(sum1);
        System.out.println(sum2);
    }
    public static int add(int a,int b){
        int sum = a + b;
        return sum;
    }
    public static double add(double c,double d,double e){
        return c+d+e;
    }
    public static void main7(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int c = scanner.nextInt();
        int max2 = max2(a,b);
        System.out.println("最大值为："+max2);
        int max3 = max3(a,b,c);
        System.out.println("最大值为："+max3);
    }
    public static int max3(int a,int b,int c){
        int max2 = max2(a,b);
        int max3 = max2(max2,c);
        return max3;
    }
    public static int max2(int a,int b){
        int i = a>b?a:b;
        return i;
    }
    public static void main6(String[] args) {
        Scanner scanner =new Scanner(System.in);
        int a=scanner.nextInt();
        int count=0;

        while(a!=0){
            count++;
            a=a&(a-1);
        }
        System.out.println(count);
    }
    public static void main5(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int i = scanner.nextInt();
        int j = scanner.nextInt();
        int n = i > j ? j : i;
        int k;
        for (k = n; k > 1; k--) {
            if(i % k == 0 && j % k == 0){
                break;
            }
        }
        if(k != 1){
            System.out.println(k);
        } else {
            System.out.println("这两个数没有最大公约数");
        }
    }
    public static void main4(String[] args) {
        double i;
        double s = 0;
        double n = 1;
        for ( i = 1; i <= 100; i++) {
            s = n * (1 / i);
            n *= (-1);
        }
        System.out.println(s);
    }
    public static void main3(String[] args) {
        int a, b, c, i;
        for(i=100;i<=999;i++) {
            a=i/100; //分解个位
            b=i/10%10; //分解十位
            c=i%100%10; //分解百位
            if(i==a*a*a+b*b*b+c*c*c) //判断是否为“水仙花数”
                System.out.println(i);
        }
    }
    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int i;
        for (i = 2; i < n; i++) {
            if(n % i == 0){
                break;
            }
        }
        if(i != n){
            System.out.println(n+"不是素数");
        }else {
            System.out.println(n+"是素数");
        }
    }
    public static void main1(String[] args) {
        int num = 0;
        int count = 0;
        for (num = 1; num <= 100; num++) {
            //判断个位上是否有 9
            if (num % 10 == 9) {
                count++;
            }
            //判断十位上是否有 9
            if (num / 10 == 9) {
                count++;
            }
        }
        System.out.println(count);
    }
}
